home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 60 / IOPROG_60.ISO / soft / c++ / gsl-1.1.1-setup.exe / {app} / include / gsl / gsl_min.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-04-20  |  3.9 KB  |  115 lines

  1. /* min/gsl_min.h
  2.  * 
  3.  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Brian Gough
  4.  * 
  5.  * This program is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation; either version 2 of the License, or (at
  8.  * your option) any later version.
  9.  * 
  10.  * This program is distributed in the hope that it will be useful, but
  11.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * General Public License for more details.
  14.  * 
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to the Free Software
  17.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  */
  19.  
  20. #ifndef __GSL_MIN_H__
  21. #define __GSL_MIN_H__
  22.  
  23. #include <stdlib.h>
  24. #include <gsl/gsl_math.h>
  25.  
  26. #undef __BEGIN_DECLS
  27. #undef __END_DECLS
  28. #ifdef __cplusplus
  29. # define __BEGIN_DECLS extern "C" {
  30. # define __END_DECLS }
  31. #else
  32. # define __BEGIN_DECLS /* empty */
  33. # define __END_DECLS /* empty */
  34. #endif
  35.  
  36. __BEGIN_DECLS
  37.  
  38. typedef struct
  39.   {
  40.     const char *name;
  41.     size_t size;
  42.     int (*set) (void *state, gsl_function * f, double minimum, double f_minimum, double x_lower, double f_lower, double x_upper, double f_upper);
  43.     int (*iterate) (void *state, gsl_function * f, double * minimum, double * f_minimum, double * x_lower, double * f_lower, double * x_upper, double * f_upper);
  44.   }
  45. gsl_min_fminimizer_type;
  46.  
  47. typedef struct
  48.   {
  49.     const gsl_min_fminimizer_type * type;
  50.     gsl_function * function ;
  51.     double minimum ;
  52.     double x_lower ;
  53.     double x_upper ;
  54.     double f_minimum, f_lower, f_upper;
  55.     void *state;
  56.   }
  57. gsl_min_fminimizer;
  58.  
  59. gsl_min_fminimizer *
  60. gsl_min_fminimizer_alloc (const gsl_min_fminimizer_type * T) ;
  61.                                       
  62. void gsl_min_fminimizer_free (gsl_min_fminimizer * s);
  63.  
  64. int gsl_min_fminimizer_set (gsl_min_fminimizer * s, 
  65.                             gsl_function * f, double minimum, 
  66.                             double x_lower, double x_upper);
  67.  
  68. int gsl_min_fminimizer_set_with_values (gsl_min_fminimizer * s, 
  69.                                         gsl_function * f, 
  70.                                         double minimum, double f_minimum,
  71.                                         double x_lower, double f_lower,
  72.                                         double x_upper, double f_upper);
  73.  
  74. int gsl_min_fminimizer_iterate (gsl_min_fminimizer * s);
  75.  
  76. const char * gsl_min_fminimizer_name (const gsl_min_fminimizer * s);
  77. double gsl_min_fminimizer_minimum (const gsl_min_fminimizer * s);
  78. double gsl_min_fminimizer_x_lower (const gsl_min_fminimizer * s);
  79. double gsl_min_fminimizer_x_upper (const gsl_min_fminimizer * s);
  80.  
  81. int
  82. gsl_min_test_interval (double x_lower, double x_upper, double epsabs, double epsrel);
  83.  
  84. #ifdef GSL_EXPORTS
  85. __declspec(dllexport) const gsl_min_fminimizer_type  * gsl_min_fminimizer_goldensection;
  86. #elif defined(GSL_IMPORTS)
  87. __declspec(dllimport) const gsl_min_fminimizer_type  * gsl_min_fminimizer_goldensection;
  88. #else
  89. extern const gsl_min_fminimizer_type  * gsl_min_fminimizer_goldensection;
  90. #endif
  91. #ifdef GSL_EXPORTS
  92. __declspec(dllexport) const gsl_min_fminimizer_type  * gsl_min_fminimizer_brent;
  93. #elif defined(GSL_IMPORTS)
  94. __declspec(dllimport) const gsl_min_fminimizer_type  * gsl_min_fminimizer_brent;
  95. #else
  96. extern const gsl_min_fminimizer_type  * gsl_min_fminimizer_brent;
  97. #endif
  98.  
  99. typedef
  100. int (*gsl_min_bracketing_function)(gsl_function *f,
  101.                    double *minimum,double * f_minimum,
  102.                    double *x_lower, double * f_lower,
  103.                                    double *x_upper, double * f_upper,
  104.                    size_t eval_max);
  105.  
  106. int 
  107. gsl_min_find_bracket(gsl_function *f,double *minimum,double * f_minimum,
  108.              double *x_lower, double * f_lower,
  109.                      double *x_upper, double * f_upper,
  110.              size_t eval_max);
  111.  
  112. __END_DECLS
  113.  
  114. #endif /* __GSL_MIN_H__ */
  115.